﻿using System;
using System.Collections.Generic;
using System.Text;

namespace TSP
{
    public class State
    {
        List<ProblemAndSolver.TSPSolution> lowestBound;
        int level;
        double lowestBoundCost;

        public State(List<ProblemAndSolver.TSPSolution> bound, int lvl)
        {
            lowestBound = bound;
            level = lvl;
        }

        public List<ProblemAndSolver.TSPSolution> LowestBound
        {
			set { lowestBound = value; }
            get { return lowestBound; }
        }

        public int Level
        {
			set { level = value; }
            get { return level; }
        }

        public double GetCost()
        {
            double result = 0;

            for (int i = 0; i < LowestBound.Count; i++)
            {
                ProblemAndSolver.TSPSolution solution = LowestBound[i];
                result += solution.costOfRoute();
            }
            return result;
        }
    }
}
